package dmir.lda;

import java.io.File;

import joptsimple.OptionParser;
import joptsimple.OptionSet;

import dmir.lda.adapters.GibbsLda;
import dmir.lda.adapters.LdaAdapter;
import dmir.lda.metrics.Perplexity;

public class Main {

	
	public static void main(String[] args) throws Exception {

//		OptionParser optParser = new OptionParser() {
//            {
//                accepts( "source" ).withRequiredArg().required();
//                accepts( "train-folder" ).withRequiredArg();
//                accepts( "test-folder" ).withRequiredArg();
//                accepts( "train-model" ).withRequiredArg();
//                accepts( "test-model" ).withRequiredArg();
//            }
//        };
//    	OptionSet options = optParser.parse( args );
        
        
		LdaAdapter train = 
				new GibbsLda(
						new File("sample_wiki/"), "model-00500");
		
		LdaAdapter test = 
				new GibbsLda(
						new File("sample_wiki/"), "sample20k.txt");
		
		double perplexity = Perplexity.getValue(train, test);
		
		System.out.println(perplexity);
	}

}
